import {DataCategory} from 'sentry/types/core';

import {ANNUAL, MONTHLY} from 'getsentry/constants';
import {CheckoutType, type Plan} from 'getsentry/types';

// mm2 plans with data volume up to 500k
const MM2_CATEGORY_DISPLAY_NAMES = {
  errors: {singular: 'error', plural: 'errors'},
};

const MM2_CATEGORIES = [DataCategory.ERRORS];

const BUDGET_TERM = 'on-demand';
const MM2_PLANS: Record<string, Plan> = {
  mm2_a_100k: {
    isTestPlan: false,
    availableCategories: [],
    basePrice: 0,
    description: '',
    id: 'mm2_a_100k',
    name: 'Business',
    categoryDisplayNames: MM2_CATEGORY_DISPLAY_NAMES,
    categories: MM2_CATEGORIES,
    checkoutCategories: MM2_CATEGORIES,
    onDemandCategories: MM2_CATEGORIES,
    budgetTerm: BUDGET_TERM,
    hasOnDemandModes: false,
    trialPlan: null,
    maxMembers: null,
    planCategories: {
      errors: [
        {
          price: 8900,
          events: 100000,
        },
      ],
    },
    totalPrice: 8900,
    reservedMinimum: 100000,
    price: 8900,
    userSelectable: true,
    allowAdditionalReservedEvents: false,
    contractInterval: MONTHLY,
    billingInterval: MONTHLY,
    allowOnDemand: true,
    onDemandEventPrice: 0.089,
    retentionDays: 90,
    features: [
      'advanced-search',
      'sso-basic',
      'weekly-reports',
      'integrations-issue-basic',
      'integrations-issue-sync',
      'events',
      'discover-basic',
      'discard-groups',
      'custom-inbound-filters',
      'data-forwarding',
      'discover',
      'global-views',
      'rate-limits',
      'sso-saml2',
      'integrations-event-hooks',
      'custom-symbol-sources',
      'relay',
      'discover-query',
      'extended-data-retention',
    ],
    availableReservedBudgetTypes: {},
  },
  mm2_a_100k_ac: {
    isTestPlan: false,
    availableCategories: [],
    basePrice: 0,
    description: '',
    id: 'mm2_a_100k_ac',
    name: 'Business',
    categoryDisplayNames: MM2_CATEGORY_DISPLAY_NAMES,
    categories: MM2_CATEGORIES,
    checkoutCategories: MM2_CATEGORIES,
    onDemandCategories: MM2_CATEGORIES,
    hasOnDemandModes: false,
    budgetTerm: BUDGET_TERM,
    trialPlan: null,
    maxMembers: null,
    planCategories: {
      errors: [
        {
          price: 8000,
          events: 100000,
        },
      ],
    },
    totalPrice: 96000,
    reservedMinimum: 100000,
    price: 8000,
    userSelectable: true,
    allowAdditionalReservedEvents: false,
    contractInterval: ANNUAL,
    billingInterval: MONTHLY,
    allowOnDemand: true,
    onDemandEventPrice: 0.08,
    retentionDays: 90,
    features: [
      'advanced-search',
      'sso-basic',
      'weekly-reports',
      'integrations-issue-basic',
      'integrations-issue-sync',
      'events',
      'discover-basic',
      'discard-groups',
      'custom-inbound-filters',
      'data-forwarding',
      'discover',
      'global-views',
      'rate-limits',
      'sso-saml2',
      'integrations-event-hooks',
      'custom-symbol-sources',
      'relay',
      'discover-query',
      'extended-data-retention',
    ],
    availableReservedBudgetTypes: {},
  },
  mm2_a_100k_auf: {
    isTestPlan: false,
    availableCategories: [],
    basePrice: 0,
    description: '',
    id: 'mm2_a_100k_auf',
    name: 'Business',
    categoryDisplayNames: MM2_CATEGORY_DISPLAY_NAMES,
    categories: MM2_CATEGORIES,
    checkoutCategories: MM2_CATEGORIES,
    onDemandCategories: MM2_CATEGORIES,
    hasOnDemandModes: false,
    budgetTerm: BUDGET_TERM,
    trialPlan: null,
    maxMembers: null,
    planCategories: {
      errors: [
        {
          price: 96000,
          events: 100000,
        },
      ],
    },
    totalPrice: 96000,
    reservedMinimum: 100000,
    price: 96000,
    userSelectable: true,
    allowAdditionalReservedEvents: false,
    contractInterval: ANNUAL,
    billingInterval: ANNUAL,
    allowOnDemand: true,
    onDemandEventPrice: 0.08,
    retentionDays: 90,
    features: [
      'advanced-search',
      'sso-basic',
      'weekly-reports',
      'integrations-issue-basic',
      'integrations-issue-sync',
      'events',
      'discover-basic',
      'discard-groups',
      'custom-inbound-filters',
      'data-forwarding',
      'discover',
      'global-views',
      'rate-limits',
      'sso-saml2',
      'integrations-event-hooks',
      'custom-symbol-sources',
      'relay',
      'discover-query',
      'extended-data-retention',
    ],
    availableReservedBudgetTypes: {},
  },
  mm2_a_500k: {
    isTestPlan: false,
    availableCategories: [],
    basePrice: 0,
    description: '',
    id: 'mm2_a_500k',
    name: 'Business',
    categoryDisplayNames: MM2_CATEGORY_DISPLAY_NAMES,
    categories: MM2_CATEGORIES,
    checkoutCategories: MM2_CATEGORIES,
    onDemandCategories: MM2_CATEGORIES,
    hasOnDemandModes: false,
    budgetTerm: BUDGET_TERM,
    trialPlan: null,
    maxMembers: null,
    planCategories: {
      errors: [
        {
          price: 28900,
          events: 500000,
        },
      ],
    },
    totalPrice: 28900,
    reservedMinimum: 500000,
    price: 28900,
    userSelectable: true,
    allowAdditionalReservedEvents: false,
    contractInterval: MONTHLY,
    billingInterval: MONTHLY,
    allowOnDemand: true,
    onDemandEventPrice: 0.089,
    retentionDays: 90,
    features: [
      'advanced-search',
      'sso-basic',
      'weekly-reports',
      'integrations-issue-basic',
      'integrations-issue-sync',
      'events',
      'discover-basic',
      'discard-groups',
      'custom-inbound-filters',
      'data-forwarding',
      'discover',
      'global-views',
      'rate-limits',
      'sso-saml2',
      'integrations-event-hooks',
      'custom-symbol-sources',
      'relay',
      'discover-query',
      'extended-data-retention',
    ],
    availableReservedBudgetTypes: {},
  },
  mm2_a_500k_ac: {
    isTestPlan: false,
    availableCategories: [],
    basePrice: 0,
    description: '',
    id: 'mm2_a_500k_ac',
    name: 'Business',
    categoryDisplayNames: MM2_CATEGORY_DISPLAY_NAMES,
    categories: MM2_CATEGORIES,
    checkoutCategories: MM2_CATEGORIES,
    onDemandCategories: MM2_CATEGORIES,
    hasOnDemandModes: false,
    budgetTerm: BUDGET_TERM,
    trialPlan: null,
    maxMembers: null,
    planCategories: {
      errors: [
        {
          price: 26000,
          events: 500000,
        },
      ],
    },
    totalPrice: 312000,
    reservedMinimum: 500000,
    price: 26000,
    userSelectable: true,
    allowAdditionalReservedEvents: false,
    contractInterval: ANNUAL,
    billingInterval: MONTHLY,
    allowOnDemand: true,
    onDemandEventPrice: 0.08,
    retentionDays: 90,
    features: [
      'advanced-search',
      'sso-basic',
      'weekly-reports',
      'integrations-issue-basic',
      'integrations-issue-sync',
      'events',
      'discover-basic',
      'discard-groups',
      'custom-inbound-filters',
      'data-forwarding',
      'discover',
      'global-views',
      'rate-limits',
      'sso-saml2',
      'integrations-event-hooks',
      'custom-symbol-sources',
      'relay',
      'discover-query',
      'extended-data-retention',
    ],
    availableReservedBudgetTypes: {},
  },
  mm2_a_500k_auf: {
    isTestPlan: false,
    availableCategories: [],
    basePrice: 0,
    description: '',
    id: 'mm2_a_500k_auf',
    name: 'Business',
    categoryDisplayNames: MM2_CATEGORY_DISPLAY_NAMES,
    categories: MM2_CATEGORIES,
    checkoutCategories: MM2_CATEGORIES,
    onDemandCategories: MM2_CATEGORIES,
    hasOnDemandModes: false,
    budgetTerm: BUDGET_TERM,
    trialPlan: null,
    maxMembers: null,
    planCategories: {
      errors: [
        {
          price: 312000,
          events: 500000,
        },
      ],
    },
    totalPrice: 312000,
    reservedMinimum: 500000,
    price: 312000,
    userSelectable: true,
    allowAdditionalReservedEvents: false,
    contractInterval: ANNUAL,
    billingInterval: ANNUAL,
    allowOnDemand: true,
    onDemandEventPrice: 0.08,
    retentionDays: 90,
    features: [
      'advanced-search',
      'sso-basic',
      'weekly-reports',
      'integrations-issue-basic',
      'integrations-issue-sync',
      'events',
      'discover-basic',
      'discard-groups',
      'custom-inbound-filters',
      'data-forwarding',
      'discover',
      'global-views',
      'rate-limits',
      'sso-saml2',
      'integrations-event-hooks',
      'custom-symbol-sources',
      'relay',
      'discover-query',
      'extended-data-retention',
    ],
    availableReservedBudgetTypes: {},
  },
  mm2_b_100k: {
    isTestPlan: false,
    availableCategories: [],
    basePrice: 0,
    description: '',
    id: 'mm2_b_100k',
    name: 'Team',
    categoryDisplayNames: MM2_CATEGORY_DISPLAY_NAMES,
    categories: MM2_CATEGORIES,
    checkoutCategories: MM2_CATEGORIES,
    onDemandCategories: MM2_CATEGORIES,
    hasOnDemandModes: false,
    budgetTerm: BUDGET_TERM,
    trialPlan: 'mm2_a',
    maxMembers: null,
    planCategories: {
      errors: [
        {
          price: 2900,
          events: 100000,
        },
      ],
    },
    totalPrice: 2900,
    reservedMinimum: 100000,
    price: 2900,
    userSelectable: true,
    allowAdditionalReservedEvents: false,
    contractInterval: MONTHLY,
    billingInterval: MONTHLY,
    allowOnDemand: true,
    onDemandEventPrice: 0.029,
    retentionDays: 90,
    features: [
      'advanced-search',
      'sso-basic',
      'weekly-reports',
      'integrations-issue-basic',
      'integrations-issue-sync',
      'events',
      'discover-basic',
      'extended-data-retention',
    ],
    availableReservedBudgetTypes: {},
  },
  mm2_b_100k_ac: {
    isTestPlan: false,
    availableCategories: [],
    basePrice: 0,
    description: '',
    id: 'mm2_b_100k_ac',
    name: 'Team',
    categoryDisplayNames: MM2_CATEGORY_DISPLAY_NAMES,
    categories: MM2_CATEGORIES,
    checkoutCategories: MM2_CATEGORIES,
    onDemandCategories: MM2_CATEGORIES,
    hasOnDemandModes: false,
    budgetTerm: BUDGET_TERM,
    trialPlan: 'mm2_a',
    maxMembers: null,
    planCategories: {
      errors: [
        {
          price: 2600,
          events: 100000,
        },
      ],
    },
    totalPrice: 31200,
    reservedMinimum: 100000,
    price: 2600,
    userSelectable: true,
    allowAdditionalReservedEvents: false,
    contractInterval: ANNUAL,
    billingInterval: MONTHLY,
    allowOnDemand: true,
    onDemandEventPrice: 0.026,
    retentionDays: 90,
    features: [
      'advanced-search',
      'sso-basic',
      'weekly-reports',
      'integrations-issue-basic',
      'integrations-issue-sync',
      'events',
      'discover-basic',
      'extended-data-retention',
    ],
    availableReservedBudgetTypes: {},
  },
  mm2_b_100k_auf: {
    isTestPlan: false,
    availableCategories: [],
    basePrice: 0,
    description: '',
    id: 'mm2_b_100k_auf',
    name: 'Team',
    categoryDisplayNames: MM2_CATEGORY_DISPLAY_NAMES,
    categories: MM2_CATEGORIES,
    checkoutCategories: MM2_CATEGORIES,
    onDemandCategories: MM2_CATEGORIES,
    hasOnDemandModes: false,
    budgetTerm: BUDGET_TERM,
    trialPlan: 'mm2_a',
    maxMembers: null,
    planCategories: {
      errors: [
        {
          price: 31200,
          events: 100000,
        },
      ],
    },
    totalPrice: 31200,
    reservedMinimum: 100000,
    price: 31200,
    userSelectable: true,
    allowAdditionalReservedEvents: false,
    contractInterval: ANNUAL,
    billingInterval: ANNUAL,
    allowOnDemand: true,
    onDemandEventPrice: 0.026,
    retentionDays: 90,
    features: [
      'advanced-search',
      'sso-basic',
      'weekly-reports',
      'integrations-issue-basic',
      'integrations-issue-sync',
      'events',
      'discover-basic',
      'extended-data-retention',
    ],
    availableReservedBudgetTypes: {},
  },
  mm2_b_500k: {
    isTestPlan: false,
    availableCategories: [],
    basePrice: 0,
    description: '',
    id: 'mm2_b_500k',
    name: 'Team',
    categoryDisplayNames: MM2_CATEGORY_DISPLAY_NAMES,
    categories: MM2_CATEGORIES,
    checkoutCategories: MM2_CATEGORIES,
    onDemandCategories: MM2_CATEGORIES,
    hasOnDemandModes: false,
    budgetTerm: BUDGET_TERM,
    trialPlan: 'mm2_a',
    maxMembers: null,
    planCategories: {
      errors: [
        {
          price: 9900,
          events: 500000,
        },
      ],
    },
    totalPrice: 9900,
    reservedMinimum: 500000,
    price: 9900,
    userSelectable: true,
    allowAdditionalReservedEvents: false,
    contractInterval: MONTHLY,
    billingInterval: MONTHLY,
    allowOnDemand: true,
    onDemandEventPrice: 0.029,

    retentionDays: 90,
    features: [
      'advanced-search',
      'sso-basic',
      'weekly-reports',
      'integrations-issue-basic',
      'integrations-issue-sync',
      'events',
      'discover-basic',
      'extended-data-retention',
    ],
    availableReservedBudgetTypes: {},
  },
  mm2_b_500k_ac: {
    isTestPlan: false,
    availableCategories: [],
    basePrice: 0,
    description: '',
    id: 'mm2_b_500k_ac',
    name: 'Team',
    categoryDisplayNames: MM2_CATEGORY_DISPLAY_NAMES,
    categories: MM2_CATEGORIES,
    checkoutCategories: MM2_CATEGORIES,
    onDemandCategories: MM2_CATEGORIES,
    hasOnDemandModes: false,
    budgetTerm: BUDGET_TERM,
    trialPlan: 'mm2_a',
    maxMembers: null,
    planCategories: {
      errors: [
        {
          price: 8900,
          events: 500000,
        },
      ],
    },
    totalPrice: 106800,
    reservedMinimum: 500000,
    price: 8900,
    userSelectable: true,
    allowAdditionalReservedEvents: false,
    contractInterval: ANNUAL,
    billingInterval: MONTHLY,
    allowOnDemand: true,
    onDemandEventPrice: 0.026,
    retentionDays: 90,
    features: [
      'advanced-search',
      'sso-basic',
      'weekly-reports',
      'integrations-issue-basic',
      'integrations-issue-sync',
      'events',
      'discover-basic',
      'extended-data-retention',
    ],
    availableReservedBudgetTypes: {},
  },
  mm2_b_500k_auf: {
    isTestPlan: false,
    availableCategories: [],
    basePrice: 0,
    description: '',
    id: 'mm2_b_500k_auf',
    name: 'Team',
    categoryDisplayNames: MM2_CATEGORY_DISPLAY_NAMES,
    categories: MM2_CATEGORIES,
    checkoutCategories: MM2_CATEGORIES,
    onDemandCategories: MM2_CATEGORIES,
    hasOnDemandModes: false,
    budgetTerm: BUDGET_TERM,
    trialPlan: 'mm2_a',
    maxMembers: null,
    planCategories: {
      errors: [
        {
          price: 106800,
          events: 500000,
        },
      ],
    },
    totalPrice: 106800,
    reservedMinimum: 500000,
    price: 106800,
    userSelectable: true,
    allowAdditionalReservedEvents: false,
    contractInterval: ANNUAL,
    billingInterval: ANNUAL,
    allowOnDemand: true,
    onDemandEventPrice: 0.026,
    retentionDays: 90,
    features: [
      'advanced-search',
      'sso-basic',
      'weekly-reports',
      'integrations-issue-basic',
      'integrations-issue-sync',
      'events',
      'discover-basic',
      'extended-data-retention',
    ],
    availableReservedBudgetTypes: {},
  },
  mm2_f: {
    isTestPlan: false,
    availableCategories: [],
    basePrice: 0,
    description: '',
    id: 'mm2_f',
    name: 'Developer',
    categoryDisplayNames: MM2_CATEGORY_DISPLAY_NAMES,
    categories: MM2_CATEGORIES,
    checkoutCategories: MM2_CATEGORIES,
    onDemandCategories: MM2_CATEGORIES,
    hasOnDemandModes: false,
    budgetTerm: BUDGET_TERM,
    trialPlan: 'am1_t',
    maxMembers: 1,
    planCategories: {
      errors: [
        {
          price: 0,
          events: 5000,
        },
      ],
    },
    totalPrice: 0,
    reservedMinimum: 5000,
    price: 0,
    userSelectable: true,
    allowAdditionalReservedEvents: false,
    contractInterval: MONTHLY,
    billingInterval: MONTHLY,
    allowOnDemand: false,
    onDemandEventPrice: 0,
    retentionDays: 30,
    features: ['advanced-search'],
    availableReservedBudgetTypes: {},
  },
  mm2_a: {
    id: 'mm2_a',
    name: 'Business',
    description: '',
    price: 0,
    basePrice: 0,
    totalPrice: 0,
    trialPlan: 'am2_business',
    isTestPlan: false,
    maxMembers: null,
    retentionDays: 90,
    userSelectable: false,
    checkoutType: CheckoutType.STANDARD,
    features: [
      'advanced-search',
      'discover-basic',
      'incidents',
      'integrations-alert-rule',
      'integrations-chat-unfurl',
      'integrations-incident-management',
      'integrations-issue-basic',
      'integrations-issue-sync',
      'sso-basic',
      'weekly-reports',
      'custom-inbound-filters',
      'custom-symbol-sources',
      'data-forwarding',
      'discard-groups',
      'dashboards-basic',
      'discover-query',
      'global-views',
      'integrations-codeowners',
      'integrations-event-hooks',
      'integrations-stacktrace-link',
      'rate-limits',
      'relay',
      'sso-saml2',
      'extended-data-retention',
    ],
    billingInterval: MONTHLY,
    contractInterval: MONTHLY,
    onDemandEventPrice: 0.089,
    allowOnDemand: true,
    reservedMinimum: 100000,
    allowAdditionalReservedEvents: true,
    categories: MM2_CATEGORIES,
    availableCategories: [],
    onDemandCategories: MM2_CATEGORIES,
    checkoutCategories: MM2_CATEGORIES,
    hasOnDemandModes: false,
    planCategories: {
      errors: [
        {
          events: 100000,
          price: 0,
        },
      ],
    },
    categoryDisplayNames: MM2_CATEGORY_DISPLAY_NAMES,
    budgetTerm: BUDGET_TERM,
    availableReservedBudgetTypes: {},
  },
};

export default MM2_PLANS;
